﻿' メモ: コンテキスト メニューの [名前の変更] コマンドを使用すると、コード、svc、および config ファイルで同時にクラス名 "Service1" を変更できます。
Public Class Service1
    Implements IService1

    Public Sub New()
    End Sub

    Public Function TestDelete(ByVal input As IO.Stream) As String Implements IService1.TestDelete
        Dim result = "DELETE METHOD CALL" + ControlChars.NewLine + ConvertReceivedMessage(input)
        Return result
    End Function

    Public Function TestGet() As String Implements IService1.TestGet
        Dim result = "GET METHOD CALL" + ControlChars.NewLine
        Return result
    End Function

    Public Function TestPost(ByVal input As IO.Stream) As String Implements IService1.TestPost
        Dim result = "POST METHOD CALL" + ControlChars.NewLine + ConvertReceivedMessage(input)
        Return result
    End Function

    Public Function TestPut(ByVal input As IO.Stream) As String Implements IService1.TestPut
        Dim result = "PUT METHOD CALL" + ControlChars.NewLine + ConvertReceivedMessage(input)
        Return result
    End Function

    Private Function ConvertReceivedMessage(ByVal req As IO.Stream) As String
        Dim result As String = ""
        Using sr As New IO.StreamReader(req)
            result = sr.ReadToEnd
        End Using
        Return result
    End Function

End Class
